class Solution:

    def passThePillow(self, n: int, time: int) -> int:
        s = time % ((n - 1) << 1)
        return n - (s - (n - 1)) if s > n - 1 else s + 1
